home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscTabMatrixPalette / MiscTabMatrixPalette.m < prev    next >
Text File  |  1995-04-12  |  1KB  |  47 lines

  1. // Copyright (C) 1995
  2. // Use is governed by the MiscKit license
  3.  
  4. #import "MiscTabMatrixPalette.h"
  5. #import "MiscTabActionCell.subproj/MiscTabActionCell.h"
  6.  
  7. @implementation  MiscTabMatrixPalette
  8.  
  9. - finishInstantiate
  10. {
  11.     NXRect              frameRect;
  12.     Matrix             *newMatrix;
  13.  
  14.     [matrix getFrame:&frameRect];
  15.  
  16.     newMatrix =
  17.         [[Matrix allocFromZone:[self zone]]
  18.         initFrame:&frameRect
  19.         mode:NX_RADIOMODE
  20.         prototype:[[MiscTabActionCell allocFromZone:[self zone]] initTextCell:"Folder Tab"]
  21.         numRows:1
  22.         numCols:2];
  23.  
  24.     [[matrix superview] replaceSubview:matrix with:newMatrix];
  25.  
  26.     [matrix free];
  27.  
  28.     matrix = newMatrix;
  29.  
  30.  // set the background gray of tabMatrix to NX_DKGRAY 
  31.     [matrix setBackgroundGray:NX_DKGRAY];
  32.  
  33.  // set the autosizing and autoscrolling attributes of the matrix 
  34.     [matrix setAutosizing:NX_WIDTHSIZABLE];
  35.     [matrix setAutoscroll:YES];
  36.  
  37.  // size tabMatrix to its cells, resize matrix so that nice NX_DKGRAY border
  38.  // frames tabs, and display it 
  39.     [matrix sizeToFit];
  40.     [matrix setAutosizeCells:YES];
  41.     [matrix sizeBy:0.0 :4.0];
  42.     [matrix display];    
  43.  
  44.     return self;
  45. }
  46. @end
  47.